<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>04员工列表练习</title>
  </head>
  <body>
    <div style="font-family: '仿宋'">
      <table
        border="1"
        style="
          text-align: center;
          width: 50%;
          height: 100vh;
          font-size: 30px;
          margin: 0 auto;
        "
      >
        <caption>
          员工工资数据表
        </caption>
        <tr>
          <td>员工编号</td>
          <td>姓名</td>
          <td>性别</td>
          <td>年龄</td>
          <td>所属部门</td>
          <td>工资额</td>
        </tr>
        <tr v-for="(staff, num) in staff">
          <td>{{num+1}}</td>
          <td>{{staff.name}}</td>
          <td>{{staff.sex}}</td>
          <td>{{staff.age}}</td>
          <td>{{staff.dept}}</td>
          <td style="text-align: right">￥{{staff.salary}}</td>
        </tr>
      </table>
    </div>
  </body>
  <script src="https://markc1d.top/vue.js"></script>
  <script>
    let v = new Vue({
      el: "body>div",
      data: {
        staff: [
          {
            name: "李梅",
            age: 23,
            sex: "男",
            dept: "财务处",
            salary: 2040,
          },
          {
            name: "陈霞",
            age: 20,
            sex: "女",
            dept: "财务处",
            salary: 1879.7,
          },
          {
            name: "程亮",
            age: 26,
            sex: "男",
            dept: "财务处",
            salary: 2045.3,
          },
          {
            name: "刘辉",
            age: 24,
            sex: "男",
            dept: "财务处",
            salary: 1915,
          },
          {
            name: "周波",
            age: 21,
            sex: "男",
            dept: "财务处",
            salary: 1820,
          },
          {
            name: "苏建",
            age: 20,
            sex: "女",
            dept: "财务处",
            salary: 1725,
          },
          {
            name: "苏康",
            age: 26,
            sex: "男",
            dept: "财务处",
            salary: 2210,
          },
          {
            name: "王红",
            age: 23,
            sex: "女",
            dept: "财务处",
            salary: 2043,
          },
          {
            name: "张三",
            age: 28,
            sex: "男",
            dept: "财务处",
            salary: 2211,
          },
        ],
      },
      method: {},
    });
  </script>
</html>
